var uuid = require('node-uuid');

module.exports = {

  tableName: 'sails_order',
  autoCreatedAt: true,
  autoUpdatedAt: true,
  attributes: {
    id: {
      type: 'string',
      primary: true,
      required: true,
      defaultsTo: function () {
        return uuid.v4();
      }
    },
    openid: {
      type: 'string',
      required: true,
      columnName: 'openid'
    },
    status: {
      type: 'string',
      columnName: 'order_status'
    },
    products: {
      type: 'string',
      columnName: 'products'
    },
    total: {
      type: 'string',
      required: true,
      columnName: 'amount'
    },
    remark: {
      type: 'string',
    },
    wmsid: {
      type: 'string',
      columnName: 'wms_id'
    },
    receiver: {
      type: 'string',
      columnName: 'receiver'
    }
  }
}
